# -*- coding: utf-8 -*-
#
# File: BevanLetter.py
#
# Copyright (c) 2008 by []
# Generator: ArchGenXML Version 2.0
#            http://plone.org/products/archgenxml
#
# GNU General Public License (GPL)
#

__author__ = """unknown <unknown>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from zope.interface import implements
import interfaces

from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin

from Products.BevanLetter.config import *

##code-section module-header #fill in your manual code here
##/code-section module-header

schema = Schema((

    StringField(
        name='document_type',
        default="single letter",
        widget=StringField._properties['widget'](
            description="i.e. single letter, 2 letters, etc.",
            label="Document type",
            label_msgid='BevanLetter_label_document_type',
            description_msgid='BevanLetter_help_document_type',
            i18n_domain='BevanLetter',
        ),
        searchable=True,
    ),
    StringField(
        name='authored_dates',
        widget=StringField._properties['widget'](
            label="Authored date/s",
            description="in the format: (d)d Month yyyy (as on letter) . For example: 4 September 1824 (4th Sep 1824)",
            label_msgid='BevanLetter_label_authored_dates',
            description_msgid='BevanLetter_help_authored_dates',
            i18n_domain='BevanLetter',
        ),
        searchable=True,
    ),
    StringField(
        name='postmark_dates',
        widget=StringField._properties['widget'](
            label="Postmark date/s",
            description="in the format: (d)d Month yyyy (as on letter) . For example: 4 September 1824 (4th Sep 1824)",
            label_msgid='BevanLetter_label_postmark_dates',
            description_msgid='BevanLetter_help_postmark_dates',
            i18n_domain='BevanLetter',
        ),
        searchable=True,
    ),
    StringField(
        name='addressee',
        widget=StringField._properties['widget'](
            description="who is the letter addressed to and where",
            label="Addressee",
            label_msgid='BevanLetter_label_addressee',
            description_msgid='BevanLetter_help_addressee',
            i18n_domain='BevanLetter',
        ),
        searchable=True,
    ),
    StringField(
        name='recipients',
        widget=StringField._properties['widget'](
            label="Recipient/s",
            description="""who is the letter written to as in "Dear ..." (leave empty if the same as the addressee)""",
            label_msgid='BevanLetter_label_recipients',
            description_msgid='BevanLetter_help_recipients',
            i18n_domain='BevanLetter',
        ),
        searchable=True,
    ),
    StringField(
        name='authors',
        widget=StringField._properties['widget'](
            label="Author/s",
            description="who wrote the letter",
            label_msgid='BevanLetter_label_authors',
            description_msgid='BevanLetter_help_authors',
            i18n_domain='BevanLetter',
        ),
        required=True,
        searchable=True,
    ),
    TextField(
        name='themes',
        widget=TextAreaWidget(
            label="Themes",
            label_msgid='BevanLetter_label_themes',
            i18n_domain='BevanLetter',
        ),
        searchable=True,
    ),
    TextField(
        name='keywords',
        widget=TextAreaWidget(
            label="Keywords",
            description="key terms in the body of the letter (a comma separated list)",
            label_msgid='BevanLetter_label_keywords',
            description_msgid='BevanLetter_help_keywords',
            i18n_domain='BevanLetter',
        ),
        searchable=True,
    ),
    TextField(
        name='glossary',
        allowable_content_types=('text/plain', 'text/structured', 'text/html', 'application/msword',),
        widget=RichWidget(
            label="Glossary",
            description="a list of terms defined in the glossary",
            label_msgid='BevanLetter_label_glossary',
            description_msgid='BevanLetter_help_glossary',
            i18n_domain='BevanLetter',
        ),
        default_output_type='text/html',
        searchable=True,
    ),
    TextField(
        name='content',
        allowable_content_types=('text/plain', 'text/structured', 'text/html', 'application/msword',),
        widget=RichWidget(
            label="Content",
            description="the content of the letter",
            label_msgid='BevanLetter_label_content',
            description_msgid='BevanLetter_help_content',
            i18n_domain='BevanLetter',
        ),
        default_output_type='text/html',
        searchable=True,
    ),
),
)

##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema

BevanLetter_schema = BaseFolderSchema.copy() + \
    schema.copy()

##code-section after-schema #fill in your manual code here
##/code-section after-schema

class BevanLetter(BaseFolder, BrowserDefaultMixin):
    """
    """
    security = ClassSecurityInfo()
    implements(interfaces.IBevanLetter)

    meta_type = 'BevanLetter'
    _at_rename_after_creation = True

    schema = BevanLetter_schema

    ##code-section class-header #fill in your manual code here
    ##/code-section class-header

    # Methods


registerType(BevanLetter, PROJECTNAME)
# end of class BevanLetter

##code-section module-footer #fill in your manual code here
##/code-section module-footer



